package cn.nexd.app.guestsystem.model;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by wangxu on 16/8/30.
 */
public class User implements Parcelable {

    private String uuid;
    private String mac;
    private String company;
    private String position;
    private String familyName;
    private String name;
    private String weight;
    private int count;
    private long exitTimeMill;

    public User() {
    }

    public User(String uuid, String mac, String company, String position, String familyName, String name, String weight) {
        this.uuid = uuid;
        this.mac = mac;
        this.company = company;
        this.position = position;
        this.familyName = familyName;
        this.name = name;
        this.weight = weight;
    }

    protected User(Parcel in) {
        uuid = in.readString();
        mac = in.readString();
        company = in.readString();
        position = in.readString();
        familyName = in.readString();
        name = in.readString();
        weight = in.readString();
        count = in.readInt();
        exitTimeMill = in.readLong();
    }

    public static final Creator<User> CREATOR = new Creator<User>() {
        @Override
        public User createFromParcel(Parcel in) {
            return new User(in);
        }

        @Override
        public User[] newArray(int size) {
            return new User[size];
        }
    };

    @Override
    public int describeContents() {
        return 0;
    }


    @Override
    public String toString() {
        return "User{" +
                "uuid='" + uuid + '\'' +
                ", mac='" + mac + '\'' +
                ", company='" + company + '\'' +
                ", position='" + position + '\'' +
                ", familyName='" + familyName + '\'' +
                ", name='" + name + '\'' +
                ", weight='" + weight + '\'' +
                ", count=" + count +
                ", exitTimeMill=" + exitTimeMill +
                '}';
    }

    @Override
    public void writeToParcel(Parcel parcel, int i) {
        parcel.writeString(uuid);
        parcel.writeString(mac);
        parcel.writeString(company);
        parcel.writeString(position);
        parcel.writeString(familyName);
        parcel.writeString(name);
        parcel.writeString(weight);
        parcel.writeInt(count);
        parcel.writeLong(exitTimeMill);
    }

    public String getUuid() {
        return uuid;
    }

    public void setUuid(String uuid) {
        this.uuid = uuid;
    }

    public String getMac() {
        return mac;
    }

    public void setMac(String mac) {
        this.mac = mac;
    }

    public String getCompany() {
        return company;
    }

    public void setCompany(String company) {
        this.company = company;
    }

    public String getPosition() {
        return position;
    }

    public void setPosition(String position) {
        this.position = position;
    }

    public String getFamilyName() {
        return familyName;
    }

    public void setFamilyName(String familyName) {
        this.familyName = familyName;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getWeight() {
        return weight;
    }

    public void setWeight(String weight) {
        this.weight = weight;
    }

    public int getCount() {
        return count;
    }

    public long getExitTimeMill() {
        return exitTimeMill;
    }

    public void setExitTimeMill(long exitTimeMill) {
        this.exitTimeMill = exitTimeMill;
    }

    public void incrementCount() {
        count++;
    }

    public void resetCount() {
        count = 0;
    }
}
